Remove obsolete MMUEXT_REASSIGN_PAGE. It's not used by
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 21 Dec 2005 18:10:53 +0000 (19:10 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 21 Dec 2005 18:10:53 +0000 (19:10 +0100)
anyone and is superceded by grant transfers.

Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/mm.c
xen/include/public/xen.h

index 4baf2252c857a3c54e75cf27b992cba8f9ec9448..c306df588f70224bb5e283060e71206c3bfa6f53 100644 (file)
@@ -1930,105 +1930,6 @@ int do_mmuext_op(
             }
             break;
         }
-
-        case MMUEXT_REASSIGN_PAGE:
-            if ( unlikely(!IS_PRIV(d)) )
-            {
-                MEM_LOG("Dom %u has no reassignment priv", d->domain_id);
-                okay = 0;
-                break;
-            }
-            
-            e = percpu_info[cpu].foreign;
-            if ( unlikely(e == NULL) )
-            {
-                MEM_LOG("No FOREIGNDOM to reassign mfn %lx to", mfn);
-                okay = 0;
-                break;
-            }
-            
-            /*
-             * Grab both page_list locks, in order. This prevents the page from
-             * disappearing elsewhere while we modify the owner, and we'll need
-             * both locks if we're successful so that we can change lists.
-             */
-            if ( d < e )
-            {
-                spin_lock(&d->page_alloc_lock);
-                spin_lock(&e->page_alloc_lock);
-            }
-            else
-            {
-                spin_lock(&e->page_alloc_lock);
-                spin_lock(&d->page_alloc_lock);
-            }
-            
-            /*
-             * Check that 'e' will accept the page and has reservation
-             * headroom. Also, a domain mustn't have PGC_allocated pages when
-             * it is dying. 
-             */
-            ASSERT(e->tot_pages <= e->max_pages);
-            if ( unlikely(test_bit(_DOMF_dying, &e->domain_flags)) ||
-                 unlikely(e->tot_pages == e->max_pages) ||
-                 unlikely(IS_XEN_HEAP_FRAME(page)) )
-            {
-                MEM_LOG("Transferee has no reservation headroom (%d,%d), or "
-                        "page is in Xen heap (%lx), or dom is dying (%ld).",
-                        e->tot_pages, e->max_pages, mfn, e->domain_flags);
-                okay = 0;
-                goto reassign_fail;
-            }
-
-            /*
-             * The tricky bit: atomically change owner while there is just one
-             * benign reference to the page (PGC_allocated). If that reference
-             * disappears then the deallocation routine will safely spin.
-             */
-            _d  = pickle_domptr(d);
-            _nd = page->u.inuse._domain;
-            y   = page->count_info;
-            do {
-                x = y;
-                if ( unlikely((x & (PGC_count_mask|PGC_allocated)) != 
-                              (1|PGC_allocated)) ||
-                     unlikely(_nd != _d) )
-                {
-                    MEM_LOG("Bad page values %lx: ed=%p(%u), sd=%p,"
-                            " caf=%08x, taf=%" PRtype_info,
-                            page_to_pfn(page), d, d->domain_id,
-                            unpickle_domptr(_nd), x, page->u.inuse.type_info);
-                    okay = 0;
-                    goto reassign_fail;
-                }
-                __asm__ __volatile__(
-                    LOCK_PREFIX "cmpxchg8b %3"
-                    : "=d" (_nd), "=a" (y), "=c" (e),
-                    "=m" (*(volatile u64 *)(&page->count_info))
-                    : "0" (_d), "1" (x), "c" (e), "b" (x) );
-            } 
-            while ( unlikely(_nd != _d) || unlikely(y != x) );
-            
-            /*
-             * Unlink from 'd'. We transferred at least one reference to 'e',
-             * so noone else is spinning to try to delete this page from 'd'.
-             */
-            d->tot_pages--;
-            list_del(&page->list);
-            
-            /*
-             * Add the page to 'e'. Someone may already have removed the last
-             * reference and want to remove the page from 'e'. However, we have
-             * the lock so they'll spin waiting for us.
-             */
-            if ( unlikely(e->tot_pages++ == 0) )
-                get_knownalive_domain(e);
-            list_add_tail(&page->list, &e->page_list);
-            
-        reassign_fail:        
-            spin_unlock(&d->page_alloc_lock);
-            spin_unlock(&e->page_alloc_lock);
-            break;
             
         default:
             MEM_LOG("Invalid extended pt command 0x%x", op.cmd);
index d07a10a87708e3e306ead08c8101646a0f8441c2..3aa683c018f7dfdabe6b6e74788615e30d1d80ea 100644 (file)
  * cmd: MMUEXT_SET_LDT
  * linear_addr: Linear address of LDT base (NB. must be page-aligned).
  * nr_ents: Number of entries in LDT.
- * 
- * cmd: MMUEXT_REASSIGN_PAGE
- * mfn: Machine frame number to be reassigned to the FD.
- *      (NB. page must currently belong to the calling domain).
  */
 #define MMUEXT_PIN_L1_TABLE      0
 #define MMUEXT_PIN_L2_TABLE      1
 #define MMUEXT_INVLPG_ALL       11
 #define MMUEXT_FLUSH_CACHE      12
 #define MMUEXT_SET_LDT          13
-#define MMUEXT_REASSIGN_PAGE    14
 #define MMUEXT_NEW_USER_BASEPTR 15
 
 #ifndef __ASSEMBLY__
 struct mmuext_op {
     unsigned int cmd;
     union {
-        /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR, REASSIGN_PAGE */
+        /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */
         unsigned long mfn;
         /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
         unsigned long linear_addr;